Repository navigation
fix(backups): openclaw-backup dead links, Turso dump retries, per-db Turso retention - #11341
Conversation
…Turso retention openclaw-backup: the state dir holds absolute links into the excluded tmp/ tree (acpx plugin vendor dirs). Once tmp/ was cleaned they dangled, the manifest step opened one and crashed, the archive was built without manifest.json, and verification failed every night from 2026-11-15. The manifest now records symlinks by target and the verifier checks them as links; a manifest or archive-creation failure now fails the run on the spot. export-turso: on 2026-11-17 the server cut the /dump stream (curl 18) on 4 of 42 databases, twice each. Dumps now get 3 retries 30 s apart (TURSO_DUMP_RETRY_DELAY_SECONDS) and databases that still fail get a second pass at the end of the run after a pause (TURSO_DUMP_RETRY_PASS_DELAY_SECONDS, default 60). cold-store prune-backups: the turso folder holds one export per database per night, but retention read it as one series and kept only the newest file per day, so it trashed 37 of the 38 fresh exports on 2026-11-17. Retention for turso now runs per source database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Before: the laptop's OpenClaw backup has failed verification every night since Nov 15, so its last offsite copy is from Nov 14. The nightly cold-store run fails whenever a Turso dump is cut off mid-download (4 of 42 databases on Nov 17). Its cleanup step then keeps only one Turso export per day across all databases: on Nov 17 it moved 37 of that night's 38 fresh Turso exports to the Drive trash.
After: the OpenClaw backup verifies even when its state dir holds links into the cleaned
tmp/tree. Turso dumps get spaced retries and a second pass at the end of the run. Turso cleanup keeps 30 daily / 12 weekly / 12 monthly exports for each database instead of for the whole folder.How
nixos/home/openclaw-backup.sh:~/.openclaw/acpx/vendor/...holds 36 absolute symlinks into~/.openclaw/tmp/plugin-captures/<id>/, which has since been cleaned out. The manifest step opened one (FileNotFoundError), had no failure check, and the archive was built withoutmanifest.json, which then failed the "VERIFY FAILED" check. The manifest now records symlinks by target ({"path", "symlink"}), and the verifier checks them withreadlink. The manifest step and archive creation nowfailimmediately. New test scenariodangling-linkreproduces the production failure against the old script and passes on the new one.pkgs/cold-store-reaper/scripts/export-turso.sh:/dumpnow uses--retry 3 --retry-delay 30(TURSO_DUMP_RETRY_DELAY_SECONDS, positive integer). Databases that still fail get one more pass afterTURSO_DUMP_RETRY_PASS_DELAY_SECONDS(default 60). The exit status and the "N of M FAILED" line count only what failed both passes.pkgs/cold-store-reaper/cold_store.py: newPER_SOURCE_RETENTION_DBS = {"turso"}. For those families,prune_backupsgroups files by the name after the stamp (turso-<stamp>-<database>.db.gz) and runs_retention_planper group. supabase and d1 are unchanged.Not in this PR (each needs Drew's yes)
openclaw-backupandcold-store-nightlyonce this is deployed.Tests
bash nixos/home/openclaw-backup.test.sh: all passed (newdangling-linkscenario included).python3 -m unittest discover -s pkgs/cold-store-reaper/tests: OK (new per-database retention and second-pass tests included).Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.